﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LCA.Community.DAL.Model;

namespace LCA.Community.DAL.Test.ModelFactories
{
    public class PostsFactory
    {
        int _count = 0;

        public PostsFactory()
        {

        }

        public Post CreateEntity(string author)
        {
            var post = new Post(
                            author,
                            author,
                            String.Format("Post {0}",_count),
                            String.Format("This is the post {0}.", _count),
                            String.Format("Test post {0}", author)
                        );
            post.RowKey = Guid.NewGuid().ToString();

            _count++;

            return post;
        }

        public List<Post> CreateList(int count, string author)
        {
            var list = new List<Post>();

            for (int i = 0; i < count; i++)
            {
                list.Add(CreateEntity(author));
                ++_count;
            }

            return list;
        }
    }
}
